package com.leaf.guidesdemos;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

	private Button mButton;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
//        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.ICE_CREAM_SANDWICH){
//        	getActionBar().setHomeButtonEnabled(true);
//        }
        
        getActionBar().setDisplayHomeAsUpEnabled(true);
        
    }

    public void testGetContent(View view){
    	
    	Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
    	intent.setType("vnd.android.cursor.item/vnd.google.note");
    	startActivity(intent);
    }
    public void goMainTwo(View view){
    	Intent intent = new Intent(null, Uri.parse("content://com.google.provider.NotePad/notes"));
        intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
    	
    	startActivity(intent);
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	
    	getMenuInflater().inflate(R.menu.activity_main, menu);
    	return true;
    }
    
    
    @Override
	public boolean onOptionsItemSelected(MenuItem item) {

		switch (item.getItemId()) {
		case android.R.id.home:
			onBackPressed();
			return true;
			
		default:
			return super.onOptionsItemSelected(item);
		}
		
		
	}
}
